<?php 
namespace app\models;
use Yii;
use yii\db\ActiveRecord;
use app\models\User;
use app\models\Article;
use app\models\Xiong;
use yii\data\Pagination;
class Comment extends ActiveRecord
{
     public static function tableName()
    {
        return 'comment';
    }
    public function rules()
    {
            return [
                 [['comment_name', 'comment_content'], 'required',],
                    
                ]
                 ;
     }
    
    
     public function attributeLabels()
    {
        return [
            'comment_name' => 'username',
            'comment_content' => '评论内容',
            
        ];
    }

   
    // 管理系统获取的comment数据
   
    public static function getCommByArtId($article_id)
    {
        $comment = Comment::find()->where(['article_id'=>$article_id])->orderBy('comment_id desc')->all();
        return $comment;
    }


}

 ?>